<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页</title>
<link rel="stylesheet" href="<%= request.getContextPath()%>/vendor/bootstrap/css/bootstrap.min.css"> 
<style>

.search {
		display: inline;
		
	}
	#formc{
		width:400px;
		float:left;
		
	}
	#btnc{
		float:left;
		
	}
	#search-div{
		margin-left:30%;
	}
	.a{
		text-decoration: none;
	}
	a:link {text-decoration: none;color:red;}
	a:visited {color:green；text-decoration:none;}
	a:hover  {color:blue;text-decoration:underline;}
	a:active {color:orange;text-decoration:blink;}
	
</style>
</head>
<body>
<div class="container">
<h1>
			登录成功 <small> 欢迎您， <span class="label label-success">${name }</span></small>
			<span class="pull-right"><button class="btn btn-warning" onclick="confirmLogout('LogOutServlet')">注销</button></span>
		</h1>

		<hr>


<a href="<%=request.getContextPath() %>static/talent/talent-login.jsp">求职者登录</a>
	<a href="<%=request.getContextPath() %>static/talent/talent-register.jsp">求职者注册</a>
	|
	<a href="<%=request.getContextPath() %>static/company/company-login.jsp">企业登录</a>
	<a href="<%=request.getContextPath() %>static/company/company-register.jsp">企业注册</a>
	<hr>
	
	<form action="<%=request.getContextPath()%>/PositionListServlet" method="post">
	<div id = "search-div">
			<input type="text" name="positionName" class="form-control search" id = "formc">
			<input type="submit" value="职位搜索" class="btn btn-primary" id = "btnc"/>
			</div>
		</form>
		
		<table class="table table-hover">
		<tr>
			<th>编号</th>
			<th>职位名</th>
			<th>公司名</th>
			<th>工作地点</th>
			<th>薪资</th>
			<th>发布时间</th>
			<th>职位详情</th>
		</tr>
		<c:if test="${! empty positionList}">
		<c:forEach items="${positionList}" var="position" varStatus="v">
		<tr>
			<td>${v.count}</td>
			<td><a href="PositionInformationServlet?id=${position.id}">${position.positionName}</a></td>
			<td>${position.companyName}</td>
			<td>${position.address}</td>
			<td>${position.salary1} - ${position.salary2}</td>
			<td>${position.releaseTime}</td>
			<td><a href="PositionInformationServlet?id=${position.id}">职位详情</a></td>
			
		</tr>
		</c:forEach>
		</c:if>
		<c:if test="${empty positionList }">
				<tr class="warning">
					<td colspan="6" align="center">暂无数据！</td>
				</tr>
			</c:if>
		
		</table>
		
</div>

<script src="vendor/jquery.min.js"></script>
	<script src="vendor/layer/layer.js"></script>
	<script>
		/**
		 * 确认删除
		 */
		function confirmDelete(url) {
			layer.confirm('确认删除？', {
				btn : [ '确认', '取消' ]
			//按钮
			}, function() {
				location = url;
			}, function() {
			});
		}
		
		/**
		 * 确认注销
		 */
		function confirmLogout(url) {
			layer.confirm('确认注销？', {
				btn : [ '确认', '取消' ]
			//按钮
			}, function() {
				location = url;
			}, function() {
			});
		}
	</script>
</body>
</html>